<?php

namespace app\admin\model\survey;

use think\Model;


class RecordsAnswer extends Model
{

    

    

    // 表名
    protected $name = 'survey_records_answer';
    
	// 自动写入时间戳字段
	protected $autoWriteTimestamp = false;
	// 定义时间戳字段名
	protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
    ];

	public static function getList($records_id){
		$res = self::where(['records_id'=>$records_id])->order('id asc')->select();
		foreach($res as &$item){
			if($item['question_type'] == 7) $item['question_value'] = json_decode($item['question_value'],true);
		}
		return $res;
	}
}
